﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using System.IO;
using MemberServerBLL;
using System.Web.Services;
using System.Collections.Specialized;
using System.Web.Configuration;
namespace Adge.Web.UI
{
    public partial class reporter : AdgePageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                display();
            }
        }

        protected void display()
        {
            ArrayList al = new ArrayList();
            try
            {
                string[] t = Roles.GetUsersInRole("通讯员");

                BLL_UserDetail userDetailBll = new BLL_UserDetail();

                foreach (string u in t)
                {
                    MembershipUser user = Membership.GetUser(u);
                    if (!user.IsLockedOut)
                    {
                        MemberShipDAL.DataObject.DataUserDetail.wmf_UserDetailRow userDetailRow = userDetailBll.GetUserDetail(user);

                        al.Add(userDetailRow);
                    }
                }
            }
            catch (Exception)
            {

                //throw;
            }

            clUsers.DataSource = al;
            clUsers.DataBind();
        }


        /// <summary>
        /// Rebind control 
        /// </summary>
        protected void PageChanged(object sender, DataGridPageChangedEventArgs e)
        {
            //reset index
            clUsers.CurrentPageIndex = e.NewPageIndex;

            display();
        }
    }
}
